package cn.dkk.behavior_design.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author dkk
 * @date 2022/7/21
 * @desc 生产者
 */
public class Producer {

    List<Command> commandList = new ArrayList<>();

    public void execute(){
        for (Command command : commandList) {
            command.execute();
        }
    }

    public void addCommand(Command command){
        commandList.add(command);
    }

}
